home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / CIncludes / iostream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-05  |  19.2 KB  |  757 lines  |  [TEXT/MPS ]

  1. /*
  2.     iostream.h -- Streams classes: ios, streambuf, istream, ostream, iostream
  3.     
  4.     Copyright Apple Computer,Inc.    1994-1995
  5.     All rights reserved.
  6.  
  7. */
  8.  
  9. #ifndef __IOSTREAM__
  10. #define __IOSTREAM__       1
  11.  
  12. #include <string.h>        // For memcpy
  13. #include <stdio.h>        // For EOF and NULL
  14.  
  15.  
  16. #define zapeof(c)       ((c) & 0377)
  17.  
  18. typedef long streampos;
  19. typedef long streamoff;
  20.  
  21. #ifdef powerc
  22. #pragma options align=power
  23. #endif
  24.  
  25. #if defined(powerc) || defined(mc68000)
  26. /*
  27.  * removed from ios.c and placed here to avoid forward reference problem - rjd 921223
  28.  */
  29. union ios_user_union
  30. {
  31.     long i_word;
  32.     void *p_word;
  33. };
  34. #endif
  35.  
  36. class streambuf;
  37. class ostream;
  38.  
  39. class ios
  40. {
  41.  
  42. public:
  43.     /*
  44.      * Some enums are declared in ios to avoid pollution of global namespace
  45.      */
  46.     enum io_state
  47.     {
  48.         goodbit  = 0,
  49.         eofbit   = 1,
  50.         failbit  = 2,
  51.         badbit   = 4,
  52.         hardfail = 0200
  53.     };
  54.     /*
  55.      * hard fail can be set and reset internally, but not via public function
  56.      */
  57.     enum open_mode
  58.     {
  59.         in        =    1,
  60.         out       =    2,
  61.         ate       =    4,
  62.         app       =  010,
  63.         trunc     =  020,
  64.         nocreate  =  040,
  65.         noreplace = 0100
  66.     };
  67.     enum seek_dir
  68.     {
  69.         beg = 0,
  70.         cur = 1,
  71.         end = 2
  72.     };
  73.     /*
  74.      * flags for controlling format
  75.      */
  76.     enum
  77.     {
  78.         skipws     =     01,        // skip whitespace on input
  79.  
  80.         left       =     02,        // padding location
  81.         right      =     04,
  82.         internal   =    010,
  83.  
  84.         dec        =    020,        // conversion base
  85.         oct        =    040,
  86.         hex        =   0100,
  87.  
  88.         showbase   =   0200,        // modifiers
  89.         showpoint  =   0400,
  90.         uppercase  =  01000,
  91.         showpos    =  02000,
  92.  
  93.         scientific =  04000,        // floating point notation
  94.         fixed      = 010000,
  95.  
  96.         unitbuf    = 020000,        // stuff to control flushing
  97.         stdio      = 040000
  98.     };
  99.     static const long basefield;    // = dec | oct | hex
  100.     static const long adjustfield;  // = left | right | internal
  101.     static const long floatfield;   // = scientific | fixed
  102.  
  103. public:
  104.     ios(streambuf*);
  105.     virtual ~ios();
  106.  
  107.     long flags() const          { return x_flags; }
  108.     long flags(long f);
  109.  
  110.     long setf(long setbits, long field);
  111.     long setf(long);
  112.     long unsetf(long);
  113.  
  114.     int  width() const          { return x_width; }
  115.     int  width(int w)           { int i = x_width; x_width = w; return i; }
  116.  
  117.     int  precision(int);
  118.     int  precision() const      { return x_precision; }
  119.  
  120.     char fill(char);
  121.     char fill() const           { return x_fill; }
  122.     ostream* tie(ostream* s);
  123.     ostream* tie()              { return x_tie; }
  124.  
  125.     operator void*()            { return (state & (failbit | badbit | hardfail)) ? NULL : this; }
  126. #if defined(powerc)
  127.     operator const void*() const{ return (state & (failbit | badbit | hardfail)) ? NULL : this; }
  128. #endif
  129.     int operator!() const       { return state & (failbit | badbit | hardfail); }
  130.     int rdstate() const         { return state; }
  131.     int eof() const             { return state & eofbit; }
  132.     int fail() const            { return state & (failbit | badbit | hardfail); }
  133.     int bad() const             { return state & badbit; }
  134.     int good() const            { return state == 0; }
  135.     void clear(int i = 0)
  136.     {
  137.         state =  (i & 0377) | (state & hardfail);
  138.         ispecial = (ispecial & ~0377) | state;
  139.         ospecial = (ospecial & ~0377) | state;
  140.     }
  141.     streambuf* rdbuf()          { return bp; }
  142.  
  143. public:
  144.     /*
  145.      * Members related to user allocated bits and words
  146.      */
  147.     long& iword(int);
  148.     void*& pword(int);
  149.     static long bitalloc();
  150.     static int xalloc();
  151.  
  152. private:
  153.     static long nextbit;
  154.     static long nextword;
  155.  
  156.     int nuser;
  157.     union ios_user_union* x_user;
  158.     void uresize(int);
  159.  
  160. public:
  161.     /*
  162.      * static member functions
  163.      */
  164.     static void sync_with_stdio();
  165.  
  166. protected:
  167.     enum
  168.     {
  169.         skipping = 01000,
  170.         tied     = 02000
  171.     };
  172.     /*
  173.      * bits 0377 are reserved for userbits
  174.      */
  175.     streambuf* bp;
  176.     void setstate(int b)
  177.     {
  178.         state |= (b & 0377);
  179.         ispecial |= b & ~skipping;
  180.         ispecial |= b;
  181.     }
  182.     int         state;
  183.     int         ispecial;
  184.     int         ospecial;
  185.     int         isfx_special;
  186.     int         osfx_special;
  187.     int         delbuf;
  188.     ostream*    x_tie;
  189.     long        x_flags;
  190.     short       x_precision;
  191.     char        x_fill;
  192.     short       x_width;
  193.  
  194.     static void (*stdioflush)();
  195.  
  196.     void init(streambuf*);      // Does the real work of a constructor.
  197.     ios();                      // No initialization at all.  Needed by multiple inheritance versions.
  198.     int assign_private;         // Needed by with_assgn classes.
  199.  
  200. private:
  201.     ios(ios&);                  // Declared but not defined
  202.     void operator=(ios&);       // Declared but not defined
  203.  
  204. public:
  205.     /*
  206.      * old stream package compatibility
  207.      */
  208.     int skip(int i);
  209.  
  210. };  // class ios
  211.  
  212.  
  213. class streambuf
  214. {
  215. public:
  216.     /*
  217.      * Constructors -- should be protected
  218.      */
  219.     streambuf();
  220.     streambuf(char* p, int l);
  221.     streambuf(char* p, int l, int c);                   // 3 argument form is obsolete. Use strstreambuf.
  222.  
  223. protected:
  224.     short       alloc;
  225.  
  226. private:
  227.     short       x_unbuf;
  228.     char*       x_base;
  229.     char*       x_pbase;
  230.     char*       x_pptr;
  231.     char*       x_epptr;
  232.     char*       x_gptr;
  233.     char*       x_egptr;
  234.     char*       x_eback;
  235.     int         x_blen;
  236.  
  237. private:
  238.     streambuf(streambuf&);      // Declared but not defined
  239.     void operator=(streambuf&); // Declared but not defined
  240.  
  241. public:
  242.     void dbp();
  243.  
  244. protected:
  245.     char*       base()          { return x_base; }
  246.     char*       pbase()         { return x_pbase; }
  247.     char*       pptr()          { return x_pptr; }
  248.     char*       epptr()         { return x_epptr; }
  249.     char*       gptr()          { return x_gptr; }
  250.     char*       egptr()         { return x_egptr; }
  251.     char*       eback()         { return x_eback; }
  252.     char*       ebuf()          { return x_base + x_blen; }
  253.     int         blen() const    { return x_blen; }
  254.     void        pbump(int n)    { x_pptr += n; }
  255.     void        gbump(int n)    { x_gptr += n; }
  256.     void setp(char* p, char* ep)
  257.     {
  258.         x_pbase = x_pptr = p;
  259.         x_epptr = ep;
  260.     }
  261.     void setg(char* eb, char* g, char* eg)
  262.     {
  263.         x_eback = eb;
  264.         x_gptr = g;
  265.         x_egptr = eg;
  266.     }
  267.     void setb(char* b, char* eb, int a = 0)
  268.     {
  269.         if (alloc && x_base)
  270.             delete x_base;
  271.         x_base = b;
  272.         x_blen = (eb > b) ? (eb - b) : 0;
  273.         alloc = a;
  274.     }
  275.     int unbuffered()            { return x_unbuf; }
  276.     void unbuffered(int unb)    { x_unbuf = (unb != 0); }
  277.     virtual int doallocate();
  278.     int allocate()              { return (x_base == 0 && !unbuffered()) ? doallocate() : 0; }
  279.  
  280. public:
  281.     virtual int overflow(int c = EOF);
  282.     virtual int underflow();
  283.     virtual int pbackfail(int c);
  284.     virtual int sync();
  285.     virtual streampos seekoff(streamoff, ios::seek_dir, int = ios::in | ios::out);
  286.     virtual streampos seekpos(streampos, int = ios::in | ios::out);
  287.     virtual int xsputn(const char* s, int n);
  288.     virtual int xsgetn(char* s, int n);
  289.  
  290.     int in_avail()
  291.     {
  292.         return (x_gptr < x_egptr) ? x_egptr - x_gptr : 0;
  293.     }
  294.     int out_waiting()
  295.     {
  296.         return (x_pptr) ? x_pptr - x_pbase : 0;
  297.     }
  298.     int sgetc()
  299.     {
  300.         /*
  301.          * WARNING: sgetc does not bump the pointer
  302.          */
  303.         return (x_gptr >= x_egptr) ? underflow() : zapeof(*x_gptr);
  304.     }
  305.     int snextc()
  306.     {
  307.         return (++x_gptr >= x_egptr) ? x_snextc() : zapeof(*x_gptr);
  308.     }
  309.     int sbumpc()
  310.     {
  311.         return (x_gptr >= x_egptr && underflow() == EOF) ? EOF : zapeof(*x_gptr++);
  312.     }
  313.     int optim_in_avail()
  314.     {
  315.         return x_gptr < x_egptr;
  316.     }
  317.     int optim_sbumpc()
  318.     {
  319.         return (underflow() == EOF) ? EOF : zapeof(*x_gptr++);
  320.     }
  321.     void stossc()
  322.     {
  323.         if (x_gptr++ > x_egptr)
  324.             underflow();
  325.     }
  326.     int sputbackc(char c)
  327.     {
  328.         if (x_gptr > x_eback)
  329.         {
  330.             if (*--x_gptr == c)
  331.                 return zapeof(c);
  332.             else
  333.                 return zapeof(*x_gptr = c);
  334.         }
  335.         else
  336.             return pbackfail(c);
  337.     }
  338.     int sputc(int c)
  339.     {
  340.         return (x_pptr >= x_epptr) ? overflow(zapeof(c)) : zapeof(*x_pptr++ = c);
  341.     }
  342.     int sputn(const char* s,int n)
  343.     {
  344.         if (n <= (x_epptr - x_pptr))
  345.         {
  346.             memcpy(x_pptr, s, n);
  347.             pbump(n);
  348.             return n;
  349.         }
  350.         else
  351.             return xsputn(s, n);
  352.     }
  353.     int sgetn(char* s,int n)
  354.     {
  355.         if (x_gptr + n <= x_egptr)
  356.         {
  357.             memcpy(s, x_gptr, n);
  358.             gbump(n);
  359.             return n;
  360.         }
  361.         else
  362.             return xsgetn(s, n);
  363.     }
  364.     virtual streambuf* setbuf(char* p, int len);
  365.     streambuf* setbuf(unsigned char* p, int len);
  366.     streambuf* setbuf(char* p, int len, int count);     // obsolete third argument
  367.     virtual ~streambuf();
  368.  
  369. private:
  370.     int x_snextc();
  371.  
  372. };  // class streambuf
  373.  
  374.  
  375. class istream : virtual public ios
  376. {
  377.  
  378. public:
  379.     /*
  380.      * Constructor, destructor
  381.      */
  382.     istream(streambuf*);
  383.     virtual ~istream();
  384.  
  385. public:
  386. #if defined(powerc) || defined(__SC__)
  387.     int         ipfx(int need);
  388. #else
  389. #if defined(applec) && !defined(__SC__)
  390.     int         ipfx(int noskipws = 0)
  391.     {
  392.         return (noskipws ? (ispecial & ~skipping) : ispecial) ? do_ipfx(noskipws) : 1;
  393.     }
  394. #endif
  395. #endif
  396.     void        isfx()                                  { }
  397.     istream&    seekg(streampos p);
  398.     istream&    seekg(streamoff o, ios::seek_dir d);
  399.     streampos   tellg();
  400.     istream&    operator>>(istream& (*f)(istream&))     { return (*f)(*this); }
  401.     istream&    operator>>(ios& (*f)(ios&));
  402.     istream&    operator>>(char*);
  403.     istream&    operator>>(unsigned char*);
  404. #if defined(powerc) || defined(__SC__)
  405.     istream&    operator>>(unsigned char& c);
  406.     istream&    operator>>(char& c);
  407. #else
  408. #if defined(applec) && !defined(__SC__)
  409.     istream&    operator>>(unsigned char& c)
  410.     {
  411.         if (!ispecial && bp->optim_in_avail())
  412.         {
  413.             c = bp->optim_sbumpc();
  414.             return *this;
  415.         }
  416.         else
  417.             return rs_complicated(c);
  418.     }
  419.     istream&    operator>>(char& c)
  420.     {
  421.         if (!ispecial && bp->optim_in_avail())
  422.         {
  423.             c = bp->optim_sbumpc();
  424.             return *this;
  425.         }
  426.         else
  427.             return rs_complicated(c);
  428.     }
  429.     istream&    rs_complicated(unsigned char& c);
  430.     istream&    rs_complicated(char& c);
  431. #endif
  432. #endif
  433.     istream&    operator>>(short&);
  434.     istream&    operator>>(int&);
  435.     istream&    operator>>(long&);
  436.     istream&    operator>>(unsigned short&);
  437.     istream&    operator>>(unsigned int&);
  438.     istream&    operator>>(unsigned long&);
  439.     istream&    operator>>(float&);
  440.     istream&    operator>>(double&);
  441. #ifdef powerc
  442.     istream&    operator>>(long double&);
  443. #else
  444. #if defined(applec) || defined(__SC__)
  445.     istream&    operator>>(extended&);
  446.     istream&    operator>>(comp&);
  447. #endif
  448. #endif
  449.     istream&    operator>>(streambuf*);
  450. #if defined (__xlc) || defined (__xlC) || defined (__xlC__)
  451.     istream&    get(char*,                int lim, char delim = '\015');
  452.     istream&    get(unsigned char* b,     int lim, char delim = '\015');
  453.     istream&    getline(char* b,          int lim, char delim = '\015');
  454.     istream&    getline(unsigned char* b, int lim, char delim = '\015');
  455.     istream&    get(streambuf& sb,                 char delim = '\015');
  456. #else
  457.     istream&    get(char*,                int lim, char delim = '\n');
  458.     istream&    get(unsigned char* b,     int lim, char delim = '\n');
  459.     istream&    getline(char* b,          int lim, char delim = '\n');
  460.     istream&    getline(unsigned char* b, int lim, char delim = '\n');
  461.     istream&    get(streambuf& sb,                 char delim = '\n');
  462. #endif
  463.     istream&    get_complicated(unsigned char& c);
  464.     istream&    get_complicated(char& c);
  465. #if defined(powerc) || defined(__SC__)
  466.     istream&    get(unsigned char& c);
  467.     istream&    get(char& c);
  468. #else
  469. #if defined(applec) && !defined(__SC__)
  470.     istream&    get(unsigned char& c)
  471.     {
  472.         if (!(ispecial & ~skipping) && bp->optim_in_avail())
  473.         {
  474.             x_gcount = 1;
  475.             c = bp->sbumpc();
  476.             return *this;
  477.         }
  478.         else
  479.             return (get_complicated(c));
  480.     }
  481.     istream&    get(char& c)
  482.     {
  483.         if (!(ispecial & ~skipping) && bp->optim_in_avail())
  484.         {
  485.             x_gcount = 1;
  486.             c = bp->sbumpc();
  487.             return *this;
  488.         }
  489.         else
  490.             return (get_complicated(c));
  491.     }
  492. #endif
  493. #endif
  494.     int get()
  495.     {
  496.         int c;
  497.         if (!ipfx(1))
  498.             return EOF;
  499.         else
  500.         {
  501.             c = bp->sbumpc();
  502.             if (c == EOF)
  503.                 setstate(eofbit);
  504.             return c;
  505.         }
  506.     }
  507.     int         peek()                                  { return (ipfx(-1)) ? bp->sgetc() : EOF; }
  508.     istream&    ignore(int n = 1, int delim = EOF);
  509.     istream&    read(char* s,int n);
  510.     istream&    read(unsigned char* s,int n)            { return read((char*)s, n); }
  511.     istream&    putback(char c);
  512.     int         gcount();
  513.     int         sync()                                  { return bp->sync(); }
  514. #if defined(powerc) || defined(__SC__)
  515.     void        eatwhite();
  516. #endif
  517.  
  518. protected:
  519. #if defined(applec) && !defined(__SC__)
  520.     void        eatwhite();
  521.     int         do_ipfx(int noskipws);
  522. #endif
  523.     istream();
  524.  
  525. private:
  526.     int         x_gcount;
  527.     void        xget(char*  c);
  528. #if defined(powerc) || defined(__SC__)
  529.     long        scan_int();
  530. #endif
  531.  
  532. #if defined(applec) || defined(__SC__)
  533. public:
  534.     /*
  535.      * Obsolete constructors, carried over from stream package.
  536.      */
  537.     istream(streambuf*, int sk, ostream* t = 0);        // obsolete, set sk and tie via format state variables
  538.     istream(int size, char*, int sk = 1);               // obsolete, use strstream
  539.     istream(int fd, int sk = 1, ostream* t = 0);        // obsolete, use fstream
  540. #endif
  541.  
  542. };  // class istream
  543.  
  544.  
  545. class ostream : virtual public ios
  546. {
  547.  
  548. public:
  549.     /*
  550.      * Constructor, destructor
  551.      */
  552.     ostream(streambuf*);
  553.     virtual ~ostream();
  554.  
  555. public:
  556. #if defined(powerc) || defined(__SC__)
  557.     int         opfx();         /* Output prefix */
  558.     void        osfx();
  559. #else
  560. #if defined(applec) && !defined(__SC__)
  561.     int         opfx()                                  { return (ospecial) ? do_opfx() : 1; }
  562.     void        osfx()                                  { if (osfx_special) do_osfx(); }
  563. #endif
  564. #endif
  565.     ostream&    flush();
  566.     ostream&    seekp(streampos p);
  567.     ostream&    seekp(streamoff o, ios::seek_dir d);
  568.     streampos   tellp();
  569.     ostream&    put(char c);
  570. #if defined(powerc) || defined(__SC__)
  571.     ostream&    operator<<(char c);
  572.     ostream&    operator<<(unsigned char c);
  573. #else
  574. #if defined(applec) && !defined(__SC__)
  575.     ostream&    complicated_put(char c);
  576.     ostream&    ls_complicated(char c);
  577.     ostream&    ls_complicated(unsigned char c);
  578.     ostream&    operator<<(char c)
  579.     {
  580.         if (ospecial || osfx_special)
  581.             return ls_complicated(c);
  582.         else
  583.         {
  584.             if (bp->sputc(c) == EOF)
  585.                 setstate(eofbit | failbit);
  586.             return *this;
  587.         }
  588.     }
  589.     ostream&    operator<<(unsigned char c)
  590.     {
  591.         if (ospecial || osfx_special)
  592.             return ls_complicated(c);
  593.         else
  594.         {
  595.             if (bp->sputc(c) == EOF)
  596.                 setstate(eofbit | failbit);
  597.             return *this;
  598.         }
  599.     }
  600. #endif
  601. #endif
  602.     ostream&    operator<<(const char*);
  603.     ostream&    operator<<(const unsigned char*);
  604.     ostream&    operator<<(int a);
  605.     ostream&    operator<<(long l);
  606. #ifdef powerc
  607.     ostream&    operator<<(float d)                     { return (*this) << (long double)d; }
  608.     ostream&    operator<<(double d)                    { return (*this) << (long double)d; }
  609.     ostream&    operator<<(long double d);
  610. #else
  611. #if defined(applec) || defined(__SC__)
  612.     ostream&    operator<<(float d)                     { return (*this) << (extended)d; }
  613.     ostream&    operator<<(double d)                    { return (*this) << (extended)d; }
  614.     ostream&    operator<<(comp d)                      { return (*this) << (extended)d; }
  615.     ostream&    operator<<(extended d);
  616. #endif
  617. #endif
  618.     ostream&    operator<<(unsigned int a);
  619.     ostream&    operator<<(unsigned long l);
  620.     ostream&    operator<<(void*);
  621.     ostream&    operator<<(streambuf*);
  622.     ostream&    operator<<(short i)                     { return *this << (int)i; }
  623.     ostream&    operator<<(unsigned short i)            { return *this << (int)i; }
  624.     ostream&    operator<<(ostream& (*f)(ostream&))     { return (*f)(*this); }
  625.     ostream&    operator<<(ios& (*f)(ios&));
  626.     ostream&    write(const char* s, int n)
  627.     {
  628.         if (!state)
  629.         {
  630.             if (bp->sputn(s, n) != n)
  631.                 setstate(eofbit | failbit);
  632.         }
  633.         return *this;
  634.     }
  635.     ostream&    write(const unsigned char* s, int n)    { return write((const char*)s, n); }
  636.  
  637. protected:
  638. #if defined(applec) || defined(__SC__)
  639.     int         do_opfx();
  640.     void        do_osfx();
  641. #endif
  642.     ostream();
  643.  
  644. #if defined(applec) || defined(__SC__)
  645. public:
  646.     /*
  647.      * Obsolete constructors, carried over from stream package.
  648.      */
  649.     ostream(int fd);            // obsolete, use fstream.
  650.     ostream(int size, char*);   // obsolete, use strstream.
  651. #endif
  652.  
  653. };  // class ostream
  654.  
  655.  
  656. class iostream : public istream, public ostream
  657. {
  658.  
  659. public:
  660.     iostream(streambuf*);
  661.     virtual ~iostream();
  662.  
  663. protected:
  664.     iostream();
  665.  
  666. };  // class iostream
  667.  
  668.  
  669. class Iostream_init;
  670.  
  671. class istream_withassign : public istream
  672. {
  673.  
  674. public:
  675.     istream_withassign();
  676. #if defined(applec) || defined(__SC__)
  677.     istream_withassign(Iostream_init*);
  678. #endif
  679.     virtual ~istream_withassign();
  680.     istream_withassign& operator=(istream&);
  681.     istream_withassign& operator=(streambuf*);
  682.  
  683. };  // class istream_withassign
  684.  
  685.  
  686. class ostream_withassign : public ostream
  687. {
  688.  
  689. public:
  690.     ostream_withassign();
  691. #if defined(applec) || defined(__SC__)
  692.     ostream_withassign(Iostream_init*);
  693. #endif
  694.     virtual ~ostream_withassign();
  695.     ostream_withassign& operator=(ostream&);
  696.     ostream_withassign& operator=(streambuf*);
  697.  
  698. };  // class ostream_withassign
  699.  
  700.  
  701. class iostream_withassign : public iostream
  702. {
  703.  
  704. public:
  705.     iostream_withassign();
  706.     virtual ~iostream_withassign();
  707.     iostream_withassign& operator=(ios&);
  708.     iostream_withassign& operator=(streambuf*);
  709.  
  710. };  // class iostream_withassign
  711.  
  712.  
  713. extern istream_withassign cin;
  714. extern ostream_withassign cout;
  715. extern ostream_withassign cerr;
  716. #if defined(powerc) || defined(__SC__)
  717. extern ostream_withassign clog;
  718. #else
  719. #if defined(applec) && !defined(__SC__)
  720. extern ostream_withassign cdebug;
  721. #endif
  722. #endif
  723.  
  724.  
  725. ios&            dec(ios&);
  726. ostream&        endl(ostream& i);
  727. ostream&        ends(ostream& i);
  728. ostream&        flush(ostream&);
  729. ios&            hex(ios&);
  730. ios&            oct(ios&);
  731. istream&        ws(istream&);
  732.  
  733.  
  734. /*
  735.  * see iostream_init.c (or MPW cstearms.c)
  736.  */
  737. class Iostream_init
  738. {
  739.  
  740.     static int stdstatus;
  741. #if defined(powerc) || defined(__SC__)
  742.     static int initcount;
  743. #endif
  744.     friend ios;
  745.  
  746. public:
  747.     Iostream_init();
  748.     ~Iostream_init();
  749.  
  750. };  // class Iostream_init
  751.  
  752. #ifdef powerc
  753. #pragma options align=reset
  754. #endif
  755.  
  756. #endif    /* __IOSTREAM__ */
  757.